package edu.hawaii.myisern.action;

import java.io.IOException;
import java.net.MalformedURLException;
import junit.framework.TestCase;
import org.junit.Test;
import org.xml.sax.SAXException;

/**
 * Tests the addOrganization ActionBean
 * 
 * @author Sonwright M. Gomez
 * 
 */
public class TestEditOrganizationActionBean extends TestCase {
  /** Get the test host. */
  private String testHost = System.getProperty("test.host");

  /**
   * Tests the editOrganization Actionbean.
   * 
   * @throws SAXException if error occurs with xml parser.
   * @throws MalformedURLException if error occurs with URL.
   * @throws IOException if error occurs with IO.
   */
  @Test
  public void testEditOrganization() throws SAXException, MalformedURLException, IOException {
    EditOrganizationActionBean ab = new EditOrganizationActionBean();
    ab.setOrganizationAffiliatedResearchers("ar");
    ab.setOrganizationContact("contact");
    ab.setOrganizationCountry("country");
    ab.setOrganizationName("name");
    ab.setOrganizationResearchDescription("description");
    ab.setOrganizationResearchKeywords("keywords");
    ab.setOrganizationType("type");
    ab.setOrganizationUrl("url");
    ab.setPossibleOrganizationName("possible");
    ab.setErrorMessage("ERROR");
    assertSame("contact same", "contact", ab.getOrganizationContact());
    assertSame("ar same", "ar", ab.getOrganizationAffiliatedResearchers());
    assertSame("country same", "country", ab.getOrganizationCountry());
    assertSame("name same", "name", ab.getOrganizationName());
    assertSame("desc same", "description", ab.getOrganizationResearchDescription());
    assertSame("keywords same", "keywords", ab.getOrganizationResearchKeywords());
    assertSame("type same", "type", ab.getOrganizationType());
    assertSame("url same", "url", ab.getOrganizationUrl());
    assertSame("possible same", "possible", ab.getPossibleOrganizationName());
    assertSame("ERROR same", "ERROR", ab.getErrorMessage());
  }
}
